<?php
my_component_load('testing' , false);
my_component_load('paging' , false);
my_component_load('cuti_konfigurasi' , false);
my_component_load('data_setting');
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;

if($_SERVER['REQUEST_METHOD'] == "POST" ):
	switch($task){
		case   "devisicreate" :
			form_devisi_submit();
			$content =  "Updated";
			generate_my_web($content,"","plain.php");
			exit;
		break;
		case   "jabatancreate" :
			form_jabatan_submit();
			$content =  "Updated";
			generate_my_web($content,"","plain.php");
			exit;
		break;
	}

else: 	
	if($task == "devisi"){
		$title= ($id > '0' ) ?  "Perubahan data devisi" : "Tambah data devisi";
		facebox_page('index.php?com=data_setting&task=devisicreate&id='.$id , $title , 90	); 
	}elseif($task == "devisicreate"){ 
		$content  = form_devisi_create();
		generate_my_web($content,"","plain.php");
		exit;
	}elseif($task == "jabatan"){
		$title= ($id > '0' ) ?  "Perubahan data jabatan" : "Tambah data jabatan";
		facebox_page('index.php?com=data_setting&task=jabatancreate&id='.$id , $title , 90	); 
	}elseif($task == "jabatancreate"){
		$content  = form_jabatan_create();
		generate_my_web($content,"","plain.php");
		exit;
	}elseif($task == 'cuti_create'){	
		$title= ($id > '0' ) ?  "Perubahan data kelompok cuti" : "Tambah data kelompok cuti";
		facebox_page('index.php?com=data_setting&task=cuti_create_page&id='.$id , $title , 100	); 
	}elseif($task == 'cuti'){	
		$pagename = "Konfigurasi struktur cuti";
		load_facebox_script();
		$view =  list_struktur_gaji();
	}elseif($task == 'cuti_create_page'){	
		$content  = form_cuti_create($id);
		generate_my_web($content,"","plain.php");
		exit;
	}else{
		$pagename = "Daftar divisi";
		load_facebox_script();
		$view =  list_divisi();
		$view .= '<br/><br/>';
		$view .=  list_jabatan();
		
	}
endif; 
$content = spliter_browser( $view , $pagename );
generate_my_web($content, "Data Konfigurasi" );
?>